package com.example8.multi_datasource;

import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.annotation.MapperScans;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @Description 多数据源
 * @Author lihw
 * @Date 2024/3/26 11:25
 */
@MapperScans({
        @MapperScan(basePackages = {"com.example8.multi_datasource.mapper.target"}, sqlSessionFactoryRef = "primarySqlSessionFactory"),
        @MapperScan(basePackages = {"com.example8.multi_datasource.mapper.source"}, sqlSessionFactoryRef = "secondarySqlSessionFactory")
})
@SpringBootApplication
public class MultiDatasourceApplication {

    public static void main(String[] args) {
        SpringApplication.run(MultiDatasourceApplication.class, args);
    }
}
